<%--
  Created by IntelliJ IDEA.
  User: w1057229265
  Date: 2021/6/21
  Time: 18:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../static/plugins/jquery-easyui-1.9.15/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../static/plugins/jquery-easyui-1.9.15/themes/icon.css">
    <script type="text/javascript" src="../static/plugins/jquery-easyui-1.9.15/jquery.min.js"></script>
    <script type="text/javascript" src="../static/plugins/jquery-easyui-1.9.15/jquery.easyui.min.js"></script>
    <script>
      $(function (){
          $('#dd').dialog({
              title: '添加订单',
              width: 400,
              height: 300,
              closed: false,
              cache: false,
              modal: true,
              buttons:[{
                  text:'保存',
                  iconCls:'icon-save',
                  handler:function (){
                      $.messager.progress();	// display the progress bar
                      $('#ff').form('submit', {
                          url: '/ServletOrder?action=reg',
                          onSubmit: function(){
                              var isValid = $(this).form('validate');
                              if (!isValid){
                                  $.messager.progress('close');	// hide progress bar while the form is invalid
                              }
                              return isValid;	// return false will stop the form submission
                          },
                          success: function(data){
                              var data = eval('(' + data + ')'); // change the JSON string to javascript object
                              if (data.code == '200'){
                                  $.messager.alert('提示',data.msg + '图书评价', 'info')
                               location.href="message.jsp"
                              }
                              else {
                                  $.messager.alert('提示',data.msg , 'warning')
                              }
                              $.messager.progress('close');	// hide progress bar while submit successfully
                          }
                      });
                  }
              },
                  {
                      text: '退出',
                      iconCls:'icon-back',
                      handler:function (){
                          location.href='/head.jsp';
                      }
                  }]
          });
      })
    </script>
</head>
<body style="background-image: url('../static/images/a.jpg')">
<div id="dd">
    <form id="ff" method="post">
        <table cellpadding="5">
            <tr>
                <td>ID:</td>
                <td><input class="easyui-validatebox" type="text" id="id" name="id" data-options="required:true"></input></td>
            </tr>
            <td>书名:</td>
            <td><input class="easyui-validatebox" type="text" id="bookname" name="bookname" data-options="required:true"></input></td>
            </tr>
            <tr>
                <td>用户名:</td>
                <td><input class="easyui-validatebox" type="text" id="username" name="username" data-options="required:true"></input></td>
            </tr>
            <tr>
                <td>数量:</td>
                <td><input class="easyui-validatebox" type="text" id="number" name="number" data-options="required:true"></input></td>
            </tr>
            <tr>
                <td>价格:</td>
                <td><input class="easyui-validatebox" type="text" id="price" name="price" data-options="required:true"></input></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>
